#include "widget.h"
#include "ui_widget.h"
#include <QDebug>
#include <QtCore>

Widget::Widget(QWidget* parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::on_pBtn_generate_clicked()
{

    for (int i = 0; i < 30; i++) {

        float a = (i * 1.0) / 3;
        qreal b = qSin(a);
        //b: -1 ~ 1

        qreal y = 20 + b * 20;
        // 0~ 40

        qDebug() << "Y: " << y;

        HBPoint p(i, y);
        m_points.append(p);
    }
    qDebug() << __FUNCTION__;
}

void Widget::on_pBtn_draw_clicked()
{
    ui->pWgt_center->configPoints(m_points);
}
